package clean_handler

import (
	"file-cleaner/internal/file_cleaner/cleaner"
	v1log "github.com/ClessLi/component-base/pkg/log/v1"
	"os"
)

type ReleaseBackupHandlerImpl struct {
}

func (r ReleaseBackupHandlerImpl) doHandle(info *cleaner.CleanTaskInfo) bool {
	err := os.Remove(info.SourceFileInfo().Path() + "." + backupSuffix)
	if err != nil {
		v1log.Error(err.Error())
		return false
	}
	v1log.Infof("Finished releasing backup file: %v", info.SourceFileInfo().Path()+"."+backupSuffix)
	return true
}
